﻿using AMM.Model;
using AMM.Model.Store;

namespace AMM.UserControls {
    public partial class SuspenseOrderSearchControl : BaseSearchControl {

        public override BaseSearchModel GetSearchModel() {
            SuspenseOrderSearchModel searchResult = new SuspenseOrderSearchModel();
            searchResult.SuspenseOrderCode = this.tbSuspenseOrderCode.Text;
            searchResult.DeliveryOrderCode = this.tbDeliveryOrderCode.Text;
            searchResult.MaterialCode = this.tbMaterialCode.Text;
            searchResult.SuspenseDateStart = this.GetDateTimePickerValue(this.dtpSuspenseDateStart);
            searchResult.SuspenseDateEnd = this.GetDateTimePickerValue(this.dtpSuspenseDateEnd);

            return searchResult;
        }

        public override void ResetSearchModel() {
            this.tbSuspenseOrderCode.Clear();
            this.tbDeliveryOrderCode.Clear();
            this.tbMaterialCode.Clear();
            this.dtpSuspenseDateStart.Checked = false;
            this.dtpSuspenseDateEnd.Checked = false;
        }

        public SuspenseOrderSearchControl() {
            this.InitializeComponent();
        }
    }
}
